#define  _CRT_SECURE_NO_WARNINGS


#include<stdio.h>
#include<string.h>


int main()
{
	char arr[1001] = { 0 };
	scanf("%s", arr);
	int len = strlen(arr), i = 0, j = 0, count = 0;
	for (i = 0; i < len;)
	{
		count = 0;
		for (j = i; 1; j++)
		{
			if (arr[i] != arr[j])
				break;
			count++;
		}
		printf("%d%c", count, arr[i]);
		i += count;
	}
	return 0;
}